<template>
  <div class="PaySuccess">
    <div class="PaySuccess-Header">
      <div class="PaySuccess-Header-Img">
        <img src="static/img/Index/sucess.png" width="100%" />
      </div>
      <div class="PaySuccess-Header-Tips">
        {{moneyStu?'缴费成功':'发生错误'}}
      </div>
      <div class="PaySuccess-Header-Num">
        已支付{{moneyStu?money:0}}元
      </div>
    </div>
    <div class="PaySuccess-Margin"></div>
    <!-- <div class="PaySuccess-Body">
			<div class="PaySuccess-Body-Title">
				恭喜获得缴费补贴
			</div>
			<div class="PaySuccess-Body-Voucher" v-for="item in VoucherList">
				<div class="Voucher-left">
					<div class="Voucher-left-Icon">
						<img :src="item.Icon" width="100%"/>
					</div>
					<div class="Voucher-left-Font">
						{{item.Title}}
					</div>
					
				</div>
				<div class="Voucher-right">
					<button @click="GotoFinancialDetail()">领取</button>
				</div>
			</div>
			
		</div> -->
    <div class="PaySuccess-Btn">
      <button @click="GoToIndex()">返回首页</button>
    </div>
  </div>
</template>

<script>
  import {
    Indicator,
    Toast
  } from 'mint-ui';
  export default {
    name: 'PaySuccess',
    data() {
      return {
        VoucherList: [{
          'Icon': 'static/img/Index/offer3.png',
          'Title': '儿童银行VIP体验课程1次券'
        }, {
          'Icon': 'static/img/Index/card2.png',
          'Title': '儿童银行余额收益提升卡(1年)'
        }],
        money: 0,
        moneyStu: false
      }
    },
    created: function () {
		var vm = this;
      if (sessionStorage.getItem('money') != null) {
        this.moneyStu = true;
        this.money = sessionStorage.getItem('money');
      } else {
        Indicator.open({
          text: '未支付或发生错误..',
        });
        setTimeout(() => {
          Indicator.close();
          vm.$router.push({
            path: `/PayNotice`
          })
        }, 1000);
      }
    },
    methods: {
      GoToIndex() {
        this.$router.push({
          path: `/Index`
        })
      },
      GotoFinancialDetail() {
        this.$router.push({
          path: `/FinancialDetail`
        })
      }

    }
  }

</script>

<style scoped>
  @import url("css/PaySuccess.css");

</style>
